﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QUANLYKHACHSAN_N4
{
    public partial class DsPhong : UserControl
    {
        public DsPhong()
        {
            InitializeComponent();

        }
        int Hang = 10, Cot1 = 10, Cot2 = 80;
        bool DungCot1=true;
        public void Create(int SoPhong)
        {
            for (int i = 0; i < SoPhong; i++)
            {
                UserPhong p = new UserPhong("Phòng " + (i+1));
                if (DungCot1)
                {
                    DungCot1 = false;
                    p.Location = new Point(Cot1, Hang);
                }
                else
                {
                    DungCot1 = true;
                    p.Location = new Point(Cot2, Hang);
                    Hang += 90;
                }
                panel1.Controls.Add(p);
            }
        }
    }
}
